package com.xzj.admin.resource.sync.domain.entity;

import com.xzj.common.core.domain.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @program: xzj-admin
 * @ClassName: ResScriptManage
 * @description: 资源处理脚本管理;
 * @author: XiaZunJun
 * @create: 2024-10-24
 */
@Schema(name = "资源处理脚本管理",description = "")
@Data
@EqualsAndHashCode(callSuper = true)
public class ResScriptManage extends BaseEntity implements Serializable{
    /** 脚本Id;脚本Id */
    @Schema(name = "脚本Id",description = "脚本Id")
    private String scriptId ;


    /** 脚本名称;脚本名称 */
    @Schema(name = "脚本名称",description = "脚本名称")
    private String scriptName ;


    /** 脚本编码;脚本编码 */
    @Schema(name = "脚本编码",description = "脚本编码")
    private String scriptCode ;


    /** 脚本内容;脚本内容 */
    @Schema(name = "脚本内容",description = "脚本内容")
    private String scriptContent ;


    /** 脚本类型(公共、私有);脚本类型(公共、私有) */
    @Schema(name = "脚本类型(公共、私有)",description = "脚本类型(公共、私有)")
    private String scriptType ;


    /** 脚本用途 */
    @Schema(name = "脚本用途",description = "")
    private String scriptUse ;


    /** 云资源Id;云资源Id */
    @Schema(name = "云资源Id",description = "云资源Id")
    private String cloudId ;


    /** 云资源类型;云资源类型 */
    @Schema(name = "云资源类型",description = "云资源类型")
    private String cloudType ;


    /** 类型+用途聚合字段 */
    @Schema(name = "类型+用途聚合字段,拼接方式 scriptType:scriptUse",description = "")
    private String typeUse;

    private List<String> cloudOptions;

    public void buildCloudOptions(){
        if(cloudId == null || cloudType == null){
            return;
        }
        this.cloudOptions = new ArrayList<>();
        cloudOptions.add(this.cloudId);
        cloudOptions.add(this.cloudType);
    }

}
